package com.qfedu.mapper;

import com.qfedu.entity.AdinmEntity;
import com.qfedu.entity.RolesEntity;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Set;

public interface AdminMapper {

    public boolean insertuser(@Param("username") String username, @Param("password") String password);

    public AdinmEntity queryuser(@Param("username") String username, @Param("password") String password);

    public AdinmEntity queryuserbyname(@Param("username") String username);

    //根据用户查询当前角色
    public Set<String> queryRoleByusername(@Param("username") String username);

    //跳转超级管理员界面并做分页
    public List<AdinmEntity> mapperList(@Param("startsource") int startsource,@Param("endsource") int endsource);

    //跳转超级管理员界面并做分页
    public AdinmEntity adminlist(AdinmEntity ad);
    //编辑admi界面
    public boolean adminedit(AdinmEntity ad);

    //查询所有角色
    public List<RolesEntity> queryroles();


    public List<RolesEntity> bianroles(@Param("start") int start,@Param("end") int end);

    //删除管理员
    public boolean delebyid(@Param("aid") int aid);

    //启用某管理员
    public boolean qiyongbyid(int aid);

    //查询所有管理员个数
    public int count();

    //查询所有管理员个数
    public int countrole();

    //删除所有
    public boolean deAll(@Param("ids") String ids);

    //添加管理员提交
    public boolean tiaoadmin(AdinmEntity ad);

    //根据角色id查询
    public RolesEntity selrole(RolesEntity ro);

    //角色修改
    public boolean editrole(RolesEntity ro);

    //添加角色
    public boolean addroleti(RolesEntity ro);

    //删除角色
    public boolean deleterole(@Param("rid") int rid);

    //先解绑当前用户所拥有的所有角色
    public boolean jiebang(@Param("aid") int aid);

    public boolean insertrole(@Param("aid") int aid,@Param("rid") int rid);

    //删除角色
    public boolean dele(@Param("rid") int rid);

}
